package cn.jiyun.service.impl;

import cn.jiyun.mapper.UsersMapper;
import cn.jiyun.pojo.Users;
import cn.jiyun.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
    private UsersMapper usersMapper;
    @Override
    public void add(Users users) {
         usersMapper.add(users);
    }

    @Override
    public List<Users> findAll() {
        List<Users> all = usersMapper.findAll();
        return  all;
    }

    @Override
    public Users getUsers(Users users) {
        return usersMapper.findByUser(users.getName(),users.getPwd());
    }
}
